/********************************************************************************
 *      Copyright:  (C) 2023 Yangpeng
 *                  All rights reserved.
 *
 *       Filename:  get_temperature.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(2023年01月05日)
 *         Author:  Yangpeng <1023769078@qq.com>
 *      ChangeLog:  1, Release initial version on "2023年01月05日 17时02分31秒"
 *                 
 ********************************************************************************/
#ifndef MQTT_ALIYUN_CONF_H
#define MQTT_ALIYUN_CONF_H

#define  BUF_SIZE 512

#define DEFAULT_CLIENTID    "i5oqviRE56z.ds18b20|securemode=2,signmethod=hmacsha256,timestamp=1673699121744|"

#define DEFAULT_USERNAME    "ds18b20&i5oqviRE56z"
#define DEFAULT_PASSWD      "e84ffa7d0c4bf58c2d00bff75d222384f5400112c175917635339219021b9467"

#define DEFAULT_HOSTNAME    "iot-06z00c6bu42mu5l.mqtt.iothub.aliyuncs.com"
#define DEFAULT_PORT        1883

#define DEFAULT_SUBTOPIC    "/sys/i5oqviRE56z/ds18b20/thing/service/property/set"
#define DEFAULT_PUBTOPIC    "/sys/i5oqviRE56z/ds18b20/thing/event/property/post"

#define DEFAULT_QOS         0

#define DEFAULT_METHOD      "thing.service.property.set"
#define DEFAULT_JSONID      "244036390"
#define DEFAULT_IDENTIFIER  "CurrentTemperature"
#define DEFAULT_VERSION     "1.0.0"

#define KEEP_ALIVE          60

enum{
    SUB,
    PUB
};

typedef struct data_mqtt
{
    char    hostname[BUF_SIZE] ;
    int     port ;
    char    username[BUF_SIZE] ;
    char    passwd[BUF_SIZE] ;
    char    clientid[BUF_SIZE] ;
    char    topic[BUF_SIZE] ;
    int     Qos;

    char    method[BUF_SIZE] ;
    char    jsonid[BUF_SIZE] ;
    char    identifier[BUF_SIZE] ;
    char    version[BUF_SIZE] ;
}data_mqtt;

int get_mqtt_conf(char *ini_path,data_mqtt *mqtt,int type);

#endif
